let path = require("path");

// 知道后缀得文件名 | 文件和后缀的全名
console.log(path.basename('https://x.dscmall.cn/user/category-860.html', '.html'));

//协议+主机+端口号
console.log(path.dirname('https://x.dscmall.cn:8090/user/category-860.html'));

// 文件的后缀名: .html
console.log(path.extname('https://x.dscmall.cn:8090/user/category-860.html'));


console.log(path.parse('https://x.dscmall.cn:8090/user/category-860.html').name);

//拼接: https:\x.dscmall.cn:8090\user\css\index.css
console.log(path.join('https://x.dscmall.cn:8090/', 'user', 'css', 'index.css'));


console.log(new URL('https://x.dscmall.cn:8090/user/category-860.html'));


